<template>
  <div>
    <button ref="refButton" @click="alertTitle">Hello World</button>
  </div>
</template>

<script setup lang="ts">
import { defineProps, defineExpose, ref, nextTick } from "vue";
const props = defineProps<{
  titles: string;
}>();
const refButton = ref();
const alertTitle = () => {
  refButton.value.innerHTML = "hello world";
  console.log(refButton.value.innerHTML);
  nextTick(() => {
    console.log("我是小写的打印");
  });
  alert(props.titles);
};
defineExpose({ alertTitle });
</script>

<style scoped></style>
